home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
clipper
/
nfsrc21.zip
/
ACH2TB.PRG
< prev
next >
Wrap
Text File
|
1992-10-17
|
35KB
|
847 lines
/*
* File......: ACH2TB.PRG
* Author....: Steve Kolterman
* CIS ID....: 76320,37
* Date......: $Date: 17 Oct 1992 16:26:12 $
* Revision..: $Revision: 1.4 $
* Log file..: $Logfile: C:/nanfor/src/ach2tb.prv $
*
* This is an original work by Steve Kolterman and is placed in the
* public domain.
*
* Modification history:
* ---------------------
*
* $Log: C:/nanfor/src/ach2tb.prv $
*
* Rev 1.4 17 Oct 1992 16:26:12 GLENN
* Leo cleaned up the documentation block.
*
* Rev 1.3 07 Oct 1992 23:31:10 GLENN
* Latest Kolterman updates.
*
* Rev 1.2 15 Aug 1991 23:17:48 GLENN
* Last minute fix sent in by Steve Kolterman
*
* Rev 1.1 15 Aug 1991 23:06:16 GLENN
* Forest Belt proofread/edited/cleaned up doc
*
* Rev 1.0 14 Jun 1991 04:14:14 GLENN
* Initial revision.
*
*/
/* $DOC$
* $FUNCNAME$
* FT_Ach2tb()
* $CATEGORY$
* Menus/Prompts
* $ONELINER$
* Replace ACHOICE() with a Tbrowse object & multiple features.
* $SYNTAX$
* FT_Ach2tb( <nToprow>,<nTopcol>[,<nBotrow>][,<nBotcol>],<aArrey>, ;
* [<cBoxtype>],[<cBoxcolor>],[<cBoxtitle>],[<nTitlePos>], ;
* [<cUselcolor>],[<cTitlecolor>],[<cBarcolor>],[<cHkcolor>], ;
* [<lShadow>],[<lExecute>],[<nMsgrow>],[<nMsgcol>], ;
* [<cMsg.color>],[cElevbar],[cEbarcolor],[<cEbarside>], ;
* [<cNoSelcolor>],[<cTagch>],[<nStartelem>],[<lRscreen>], ;
* [<nTimeout>],[<nTimeoutval>],[<cUserfunc>] )
* --> nOption
*
* $ARGUMENTS$
*
* <nToprow> is the top row of the box to be drawn. Required.
*
* <nTopcol> is the top column of the box to be drawn. Required.
*
* <nBotrow> is the bottom row of the box to be drawn. The default is
* <nToprow>+Len(<aArrey>)+1 or maxrow()-2, whichever is less.
*
* <nBotcol> is the bottom column of the box to be drawn. The default
* is <nTopcol>+width of the widest element in <aArrey> +2.
*
* It's been pointed out that the number of commas required to default
* the <nBotrow> and <nBotcol> params. is at least slightly confusing.
* So, some documentation on the requirements:
* Default both: 7,9,, ARRAY:
* Default <nBotrow>, specify <nBotcol>: 7,9,,20 ARRAY:
* Default <nBotcol>, specify <nBotrow>: 7,9,15, ARRAY:
*
* <aArrey> is the arrey of options to present to the user. Each
* element can hold as many as five subelements, or as few as one.
* Required. Additional documentation below.
*
* <cnBoxtype> is the type of box to draw. Uses DispBox(). The
* default is a double-line box.
*
* <cBoxcolor> is the color with which to draw the box. The default is
* Setcolor().
*
* <cBoxtitle> is title of the box drawn on <nToprow>. The default is
* no title.
*
* <nTitlepos> is the starting column position (to the right of
* <nTopcol>) at which to draw <cBoxtitle>. The default is 1.
*
* <cUselcolor> is the color with which to draw unselected options.
* The default is Setcolor().
*
* <cTitlecolor> is the color with which to draw the box title. The
* default is yellow on red.
*
* <cBarcolor> is the color with which to draw the selection bar.
* The default is yellow on black.
*
* <cHkcolor> is the default color with which to draw the hotkeys for
* for each option. This is used when no hotkey color is supplied
* in <aArrey>. The default is hiwhite on the current background
* color.
*
* <cShadow> is a character string, either "L" or "R" (for left or
* right) to designate the side of the box where a shadow will appear.
* Leave this NIL to avoid drawing a shadow. You might also leave
* this NIL if you choose to use a .C or .ASM shadow function, which
* is a good idea. Shadoww(), included below, is flat-out SLOW.
*
* <lExecute> turn on/off execution of option when first letter is
* pressed. Rule: setting in element 5 of each <aArrey> subarray
* overrides <lexecute>. If that element is left NIL, the <lexecute>
* setting is used. If <lexecute> is not passed and element 5 is NIL,
* auto execution is turned ON.
*
* <nMsgrow> is the row on which to draw a message for each option.
* The default is two rows below the bottom of the box.
*
* <nMsgcol> is the column at which to draw a message for each option.
* The default is <nTopcol> +2. To CENTER the message, pass "C".
*
* <cMsgcolor> is the default color with which to draw messages. This
* color is used when element 4 of each <aArrey> subarray is left NIL.
* The default is Setcolor().
*
* <cElevbar> is the ASCII character to use as the elevator bar drawn
* on the box. Leave this NIL to draw no elevator bar.
*
* <cEbarcolor> is the color with which to draw the elevator bar.
* This is ignored if <cElevbar> is NIL.
*
* <cEbarside> is a character string, either "L" or "R" (for left or
* right) to designate the side of the box on which to draw the
* elevator bar. This is ignored if <cElevbar> is NIL.
*
* <cNoselcolor> is the color with which to draw unselectable options.
* The default is white on black.
*
* <cTagchar> is the ASCII character to use to draw tags that would
* appear to the right of each option. The default is *DIS*abled
* tagging. The default tag is "√" (chr(251)).
*
* <nStartelem> is the number of the option where the selection bar
* will first be placed. Leave this NIL to begin at option 1.
*
* <lRestscrn> is a logical to designate whether or not the screen
* coordinates occupied by the box and/or shadow should be restored
* before FT_Ach2tb() returns. The default is .T.
*
* <nTimeout> is the number of seconds after which FT_ACH2TB() will
* timeout and return to the function/proced. which called it. The
* default is 0.
*
* <nTimeoutVal> is an optional alternative numeric value FT_ACH2TB() will
* RETURN when/if it times out. The default is the current element
* number.
*
* <bUserfunc> is a code block containing a function call to be
* executed after each key press. You need to write just two formal
* parameters to allow the run-time passing of the key pressed and the
* current element number, e.g.:
* { |key,num| Myfunc( key,num [,other params.] ) }
* Unlimited extra parameters may be passed. Of course, make certain
* to also write 'receptors' for them in 'Myfunc()' itself...as in the
* above example. The default is NO user function.
*
* $RETURNS$
* the number of the selected option, or 0 if [Esc] is pressed.
*
* $DESCRIPTION$
* FT_Ach2tb() is a greatly enhanced, fully featured, and now mouse-
* supported replacement for Achoice(), based on a Tbrowse object.
* Each element of <aArray> (the array you pass to it) is itself an
* array. Each element can solely composed of "Option" (below), but
* may be composed as follows to take full advantage of the function's
* features:
*
* Option , Message ,HotKeyPos,HotKeyColor,Selectable
* { "Utilities","System Utilities", 3 ,"+gr/b" ,.T. }
*
* All elements except for the first, the option itself, are optional.
* IF 'Message' is NIL, no message is displayed. 'HotKeyPos' is the
* position within 'Option' of the hotkey. In the example above, the
* hotkey for 'Utilities' is the first 'i', i.e., at position 3. The
* default is 1. 'HotKeyColor' is the color to use for the hotkey
* display. The default is hiwhite on the current background color.
* 'Selectable' is a logical indicating whether or not that option can
* be selected. The default is .T.
*
* The A_CHOICE() UDC in FT_ACH2T.CH makes using FT_ACH2TB() a breeze.
* The myriad of parameters can be written in